fopen64 | 您所在的位置:网站首页 › linux fopen打开文件失败 › fopen64 |
fopen64是linux特有 的,fopen64()函数和fopen()函数相同的,只是底层的文件描述符创建是带有O_LARGEFILE标志。fopen64()函数为了加载大型文件所做的扩展。 fopen returns FILE*, stream. fopen64 returns int, file descriptor 通常情况下,我们用fopen()函数来读问件,但是当文件超过2GB的时候,fopen()将不能读取那个文件,但是fopen64()可以。 但是如果用fopen()函数读文件,编译的时候加上-D_FILE_OFFSET_BITS=64指令,则获得的效果和fopen64()是一样的,因此,我们一般建议用fopen()函数,因为它更具有通用性,fopen64()是non-standard,fopen是standard函数。
参考文献: http://cboard.cprogramming.com/c-programming/149806-difference-between-fopen-fopen64.html http://www.mkssoftware.com/docs/man3/fopen.3.asp http://forum.ubuntu.org.cn/viewtopic.php?t=23741 |
CopyRight 2018-2019 实验室设备网 版权所有 |